<div class="underlying" style="width:100%;display: flex;flex-direction: row;flex-wrap: wrap;">
    <div class="table">
        <!-- 头部Table -->
        <nz-table #nestedTable style="border-collapse: collapse; border-radius: 4px 4px 0px 0px;"
            [nzScroll]="{x:'2895px',y:'750px'}" [nzData]="tempData" class="designTable" [nzShowPagination]='false'>
            <thead class="tableHeard" style="text-align: center !important;">
                <tr style="text-align: center !important;">
                    <th nzWidth="55px"></th>
                    <th nzWidth="40px"></th>
                    <th nzWidth="50px"></th>
                    <th nzWidth="230px">工聯單號</th>
                    <th nzWidth="200px">廠區</th>
                    <th nzWidth="200px">機種</th>
                    <th nzWidth="230px">治具名稱</th>
                    <th nzWidth="230px">19碼</th>
                    <th nzWidth="150px">數量</th>
                    <th nzWidth="150px">填單人姓名</th>
                    <th nzWidth="150px">申請部門負責人</th>
                    <th nzWidth="150px">設計期限</th>
                    <th nzWidth="200px">設計備註</th>
                    <th nzWidth="200px">退單備註</th>
                    <th nzWidth="220px">工作時間統計</th>
                    <th nzWidth="150px">預計時間</th>
                    <th nzWidth="150px">實際時間</th>
                    <th>治具交期</th>

                </tr>
            </thead>
            <!-- 工联单Table -->
            <tbody class="tablecontent" style="border-left: 1px solid rgba(71,156,156,1) !important;">
                <ng-container *ngFor="let item of tempData let bigKey = index">
                    <tr id="first">
                        <td>
                            <!-- <a class="warning" *ngIf="showBigWarning[bigKey] || item.tip !== ''"></a> -->
                            <a *ngIf="item.tip == 1" class="new"></a>
                            <a *ngIf="item.tip == 2" class="warning"></a>
                        </td>
                        <td>
                            <a class="attich" (click)="downLoad(item)"></a>
                        </td>
                        <td nzShowExpand [(nzExpand)]="item.expand" style="color: rgba(48,73,77,1);min-width:40px"
                            (nzExpandChange)="collapse(bigKey)">
                        </td>
                        <!-- 工联单号 -->
                        <td style="text-align: left;">
                            <span style="cursor: pointer; overflow: hidden;"
                                title="{{item.union_order}}">{{item.union_order}}</span>
                        </td>
                        <!-- 厂区 -->
                        <td>
                            {{item.factory === 'null' ? '' : item.factory}}
                        </td>

                        <!-- 机种 -->
                        <td style=" text-align: center;"><span
                                style="text-overflow: -o-ellipsis-lastline;overflow: hidden; text-overflow: ellipsis;display: -webkit-box;
                             -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical; cursor:pointer;width: 200px;">{{item.machine_type}}</span>
                        </td>
                        <!-- 治具名称 -->
                        <td style="text-align: left;" title="{{item.name}}"> <span
                                style="text-overflow: -o-ellipsis-lastline;overflow: hidden; text-overflow: ellipsis;display: -webkit-box;
                        -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical; cursor:pointer;width: 230px;">
                                {{item.name}}
                            </span></td>

                        <!-- 19码悬浮框 -->
                        <td class="fontColor" *ngIf="!item.code19"
                            style="text-decoration:underline;cursor:pointer;text-align: left;text-indent: 20px;">
                            <a class="add19code"></a>
                        </td>
                        <td class="fontColor" *ngIf="item.code19"
                            style="cursor:pointer;text-align: left;text-indent: 10px;"
                            title={{item.code19.split(splitJudge)[0]}}~{{item.code19.split(splitJudge)[1]}}>
                            {{item.code19.split(",")[0]}}
                        </td>

                        <!--數量  -->
                        <td>{{item.quatity}}</td>
                        <!-- 填單人姓名 -->
                        <td>{{item.apply_person}}</td>
                        <!-- 申請部門負責人 -->
                        <td>{{item.applyDeptPIC}}</td>
                        <!-- 设计期限 -->
                        <td title={{item.design_end_date}}><span style=" ext-overflow: -o-ellipsis-lastline;overflow: hidden; text-overflow: ellipsis;display: -webkit-box;
                             -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical; cursor:pointer">
                                {{item.design_end_date}}</span></td>
                        <!-- 设计备注 -->
                        <td *ngIf="item.design_remark !== ''" style="cursor:pointe;" class="fontColor"
                            (click)="addRemark(item)" title={{item.design_remark}}>
                            <span
                                style=" ext-overflow: -o-ellipsis-lastline;overflow: hidden; text-overflow: ellipsis;display: -webkit-box;
                                 -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical; width:200px;text-align: left;">
                                {{item.design_remark}}
                            </span>
                        </td>
                        <td *ngIf=" !item.design_remark || item.design_remark === '' ">
                            <a style="text-align: center !important;" class="addRemark" (click)="addRemark(item)"></a>
                        </td>
                        <!-- 退单备注 -->
                        <td style="text-align: left;" title={{item.other_remark}}><span
                                style="text-overflow: -o-ellipsis-lastline;overflow: hidden; text-overflow: ellipsis;display: -webkit-box;
                             -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical; cursor:pointer;">{{item.other_remark}}</span></td>
                        <td style="align-items: center;text-align: left;" (click)="clickLine(bigKey,item.priority)">
                            <div *ngIf="ishowerer[bigKey]">
                                <span class="start" (click)="start(item,bigKey)"></span>
                                <i>{{sfmtime}}</i>
                                <span class="end" (click)="end(item,bigKey)"></span>
                            </div>
                        </td>

                        <!-- 預計時間 -->
                        <td>
                            {{item.estimate_time === null ? '' : (item.estimate_time === '' ? '' : item.estimate_time +
                            '小時') }}
                        </td>
                        <!-- 實際時間 -->
                        <td>{{item.sheji_shijian =='' || 0 ? '' : item.sheji_shijian +'小時'}}
                        </td>
                        <!-- 開始時間 -->
                        <!-- 治具交期 -->
                        <td>{{item.delivery_date}}</td>

                    </tr>
                    <tr [(nzExpand)]="item.expand">
                        <td colspan="19" style="padding-left:0rem !important;">
                            <!-- 展开治具Table -->
                            <nz-table #innerTable [nzData]="workData[bigKey]" nzSize="middle"
                                [nzShowPagination]="false">
            <tbody class="downData" style="width: 100%;">
                <tr *ngFor="let item of workData[bigKey] let key = index" id="second"
                    style="text-align: center !important;">

                    <td style="width:55px">
                        <a class="warning" *ngIf="showWarning[bigKey][key]"></a>
                    </td>
                    <td style="width:40px">
                        <a class="attich2" (click)="downLoad2(item)"></a>
                    </td>
                    <td style="width:50px"></td>
                    <!-- 工联单号 -->
                    <td style="width:230px" title="{{item.sheet_order}}">
                        <span
                            style="text-overflow: -o-ellipsis-lastline;overflow: hidden; text-overflow: ellipsis;display: -webkit-box;
                                           -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical;text-align: left; cursor: pointer;width: 230px;">
                            {{item.sheet_order}}</span>
                    </td>
                    <td style="width:200px"></td>

                    <!-- 机种 -->
                    <td style="width:200px"></td>
                    <!-- 治具名稱 -->
                    <td style="width:230px"></td>
                    <!-- 19碼 -->
                    <td style="width:230px"></td>
                    <!-- 數量 -->
                    <td style="width:150px;text-align: center;">{{item.quatity_total}}</td>
                    <!-- 填單人姓名 -->
                    <td style="width:150px"></td>
                    <!-- 申請部門負責人 -->
                    <td style="width:150px"></td>
                    <!-- 设计期限 -->
                    <td style="width:150px"></td>
                    <!-- 设计备注 -->
                    <td style="width:200px"></td>
                    <!-- 退单备注 -->
                    <!-- <td style="width:150px;text-align: center" title="{{item.remark}}">
                         <span
                            style="text-overflow: -o-ellipsis-lastline;overflow: hidden; text-overflow: ellipsis;display: -webkit-box;
                                             -webkit-line-clamp: 1;line-clamp: 1;-webkit-box-orient: vertical; cursor: pointer;width: 150PX;">
                            {{item.remark}}
                        </span> -->
                    <td style="width:200px"></td>

                    <!-- 工作時間統計 -->
                    <td style="width:220px"></td>
                    <!-- 預計時間 -->
                    <td style="width:150px"></td>
                    <!-- 實際時間 -->
                    <td style="width:150px"></td>
                    <!-- 開始時間 -->
                    <!--  治具交期-->
                    <td></td>
                </tr>
            </tbody>
        </nz-table>
        </td>
        <!-- <td id="fouth"></td> -->
        </tr>
        </ng-container>
        </tbody>
        </nz-table>

        <!-- 添加设计备注 -->
        <nz-modal class="designRemark" [(nzVisible)]="addRemark1" [nzTitle]="nzTitle" [nzContent]="nzContent"
            [nzFooter]="nzFooter" (nzOnCancel)="addRemarkCancel()"
            [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}"
            [nzBodyStyle]="{height:'200px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',textAlign:'left',lineHeight:'20px'}">
            <ng-template #nzTitle>設計備註</ng-template>
            <ng-template #nzContent>
                <div class="li" *ngFor="let item3 of dlyy let key3 = index" style="display: inline-block;">
                    <label nz-checkbox [(ngModel)]="item3.show" (ngModelChange)="bzclick(item3.name)">
                        <span style="cursor:pointer; color: #fff;">{{item3.name}}</span>
                    </label>
                </div>
                <!-- <p>+ Add</p> -->
            </ng-template>
            <ng-template #nzFooter>
                <button nz-button [nzType]="'primary'" (click)="addRemarkAdd()">添加</button>
                <button nz-button [nzType]="'primary'" (click)="addRemarkDelete()">删除</button>
                <button nz-button [nzType]="'primary'" (click)="addRemarkCancel()">取消</button>
                <button nz-button [nzType]="'primary'" (click)="addRemarkOk()">确定</button>

            </ng-template>
        </nz-modal>
        <!-- 添加设计备注 -->
        <nz-modal class="designRemark" [(nzVisible)]="addDlyy" [nzTitle]="nzTitle1" [nzContent]="nzContent1"
            [nzFooter]="nzFooter1" (nzOnCancel)="addRemarkAddCancel()" style="text-align:center"
            [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}"
            [nzBodyStyle]="{height:'200px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',textAlign:'center',lineHeight:'20px'}">
            <ng-template #nzTitle1>添加備註</ng-template>
            <ng-template #nzContent1>
                <div class="input_first">
                    <div class="titlew">備注名：</div>
                    <input type="text" [(ngModel)]='dlyyadd'>
                </div>
                <!-- <p>+ Add</p> -->
            </ng-template>
            <ng-template #nzFooter1>
                <button nz-button [nzType]="'primary'" (click)="addRemarkAddCancel()">取消</button>
                <button nz-button [nzType]="'primary'" (click)="addRemarkAddOk()">确定</button>

            </ng-template>
        </nz-modal>

        <!-- <nz-modal class="designRemark" [(nzVisible)]="addRemark1" nzTitle="設計備註" (nzOnCancel)="CancelAddRemark()" (nzOnOk)="addRemarkOk()" [nzOkLoading]="isOkLoadingRemark" style="text-align:center" [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}" [nzBodyStyle]="{height:'200px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',textAlign:'center',lineHeight:'20px'}"> -->
        <!-- <div>
                <textarea nz-input [(ngModel)]="designRemark" [nzAutosize]="{ minRows: 2, maxRows: 6 }"
                    class="deRemark"></textarea>
                <div style="margin:24px 0;"></div>
            </div> -->
        <!-- <div class="li" *ngFor="let item3 of dlyy let key3 = index">
                <label nz-checkbox [(ngModel)]="item3.show" (ngModelChange)="bzclick(item3.name)"><span
                        style="cursor:pointer; color: #fff;">{{item3.name}}</span></label>
            </div>
        </nz-modal> -->

        <!-- 上传文件 -->
        <nz-modal [(nzVisible)]="fileInfom" nzTitle="文件信息" (nzOnCancel)="CancelShow()" (nzOnOk)="ShowOK()"
            [nzOkLoading]="isOkLoadingfileInfom" style="text-align:center" nzWidth='1000px'
            [nzBodyStyle]="{height:'600px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'18px',textAlign:'center',lineHeight:'20px'}">
            <!-- <div style="width:100%;height:100%"> -->
            <!-- 加载中 -->
            <nz-spin [nzSize]="'large'" *ngIf="isLoading"
                style="position: absolute;width: 100vw;height: 100vh;margin-left: -25.5vw;margin-top: -16vh;">
            </nz-spin>
            <div style="text-align:left;border-bottom: 1px solid rgba(36,54,58,1);background: #30494d;">
                <div style="width:100% !important;height:1px;background: rgba(36,54,58,1);"></div>
                <input type="file" nv-file-select uploader="uploader"
                    style="color:#ffffff; position: absolute;margin-left: 50px; ;margin-top: 16px;" value="点击上传文件"
                    multiple (change)="openFile($event)">
                <a class="upload" (click)="Upload()"></a>
            </div>
            <div style="text-align:left;line-height: 45px;">
                <nz-table class="tb_file" #rowSelectionTable [nzShowPagination]="false" nzShowSizeChanger
                    [nzData]="listOfData" (nzCurrentPageDataChange)="currentPageDataChange($event)"
                    style="height: 540px;overflow: auto;">
                    <thead>
                        <tr style="height:20px;">
                            <th style="min-width:250px;text-align:center">文件名稱</th>
                            <th style="min-width:250px;text-align:center">上傳時間</th>
                            <th style="min-width:100px;text-align:center">文件狀態</th>
                            <th style="min-width:250px;text-align:center">備註</th>
                            <th style="min-width:50px;text-align:center"></th>
                        </tr>
                    </thead>
                    <tbody class="uploadTable">
                        <tr *ngFor="let data of listOfData" class="list_hover" style="text-align: center !important;">
                            <td style="width:250px;text-align:center;">
                                <!-- 下载 -->
                                <a [href]="link" [download]="data.file_name" (click)="downLoadFile(data)">
                                    {{data.file_name}}
                                </a>
                            </td>
                            <td style="width:250px;text-align:center">{{data.upload_time}}</td>
                            <!-- 审核状态 -->
                            <td style="width:100px;text-align:center" *ngIf="data.file_status === 0" ngDefaultControl>
                                未审核
                            </td>
                            <td style="width:100px;text-align:center" *ngIf="data.file_status === 1" ngDefaultControl>
                                已審核
                            </td>
                            <td style="width:100px;text-align:center" *ngIf="data.file_status === 2" ngDefaultControl>
                                已退回
                            </td>

                            <td style="width:250px;text-align:center">{{data.remark}}</td>

                            <td style="width:50px;text-align:center">
                                <a class="delFile" (click)="showDelFile(data)"></a>
                            </td>

                            <!-- <td></td> -->
                        </tr>
                    </tbody>
                </nz-table>
            </div>
        </nz-modal>
        <!-- 上传文件 -->
        <nz-modal [(nzVisible)]="fileInfom2" nzTitle="文件信息" (nzOnCancel)="CancelShow2()" (nzOnOk)="ShowOK2()"
            [nzOkLoading]="isOkLoadingfileInfom" style="text-align:center" nzWidth='1000px'
            [nzBodyStyle]="{height:'600px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'18px',textAlign:'center',lineHeight:'20px'}">
            <ul>
                <li *ngFor="let item of imglist" style="height: 20px;padding: 10px;"> <a [href]=link+item
                        [download]=item>{{item}}
                    </a></li>
            </ul>
        </nz-modal>
        <!-- 删除文件信息 -->
        <nz-modal [(nzVisible)]="isFileVisible" nzTitle="刪除" (nzOnCancel)="handleFileCancel()" (nzOnOk)="delFileOk()"
            [nzOkLoading]="isFileOkLoading" [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}"
            [nzBodyStyle]="{height:'200px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',fontWight:'300',textAlign:'center',lineHeight:'200px'}">
            <p>確認刪除這個文件信息嗎？</p>
        </nz-modal>

    </div>
</div>